home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
ada
/
gwuada_5.zip
/
adaed
/
nyudemos
/
pager2.doc
< prev
next >
Wrap
Text File
|
1992-09-01
|
15KB
|
478 lines
PAGER2
by Richard Conn
PAGER2 is a tool for creating paged files,
extracting the component files from a paged file, and
scanning paged files, where a paged file is a
file composed of one or more files prefixed by
banners. PAGER2 is based in concept on the
UNPAGE tool submitted to the Ada Software Repository
on SIMTEL20 by Mitre Corporation.
Paged files are convenient mechanisms for
storing related files. They reduce cluttering
in the directories and simplify the file transfer
process by requiring the user to transfer only one
file in order to obtain all files pertinent to a
particular project or tool. Additionally, paged
files are text files which can be handled more
readily than the 8-bit binary images associated with
other file grouping mechanisms (see the file
OILBR.DOC in the directory PD2:<ADA.GENERAL>
in the Ada Software Repository). Paged files may
be manipulated by a text editor if necessary.
For these reasons, paged files have been
adopted as a standard for file storage in the
Ada Software Repository. The file type of SRC (as in
MYFILE.SRC) indicates that a file is paged.
1. PAGED FILE FORMAT
A paged file is a file composed of one or more files
prefixed by banners of the form:
::::::::::
filename
::::::::::
or
--::::::::::
--filename
--::::::::::
The first banner conforms to the PAGE standard
employed on UNIX. The second banner is an adaptation of
the first form which resembles Ada comments. The second
banner is convenient when the paged file contains
several files associated with a particular Ada program
and they are placed in the paged file in compilation
Richard Conn Page 1
PAGER2
order. The resulting paged file may then be compiled
without being disassembled first.
2. PAGER2 COMMANDS
PAGER2 responds to the following commands:
1. PAGE or P - create a paged file
2. UNPAGE or U - extract the components of a
paged file into their separate files
3. LIST or L - list components of a paged
file to the screen
4. INCLUDE or I - list components of a paged
file into an include file
5. HELP or H - print a command summary
6. EXIT or X - exit PAGER2
The case used to enter these command verbs is not
significant. The case used to enter the file names
referenced as arguments to the command verbs is significant
if the host operating system distinguishes case in file
names, as does UNIX (but not MSDOS).
2.1. PAGE Command
The PAGE function is used to created a paged file
from one or more component files. The syntax of the PAGE
command is:
PAGE [filename | @include_filename]+ paged_file_name
Two or more file names may be specified after the PAGE
verb. The last file name is the name of the paged file to
be created. The other file names are the names of files to
be placed into the paged file or the names of include files
from which the names of files to be placed into the paged
file are to be extracted.
If the user prefixes the name of a component file with
an atsign character (@), the indicated file is processed
as an include file. An include file is a file which
contains the names of zero or more component files,
one name per line starting in the first column. Other
Richard Conn Page 2
PAGER2
include files may be referenced within an include
file by prefixing their names with the atsign
character. Comments may be placed within an include file
by placing two dashes in the first two columns of a
line. The following is an example of an include file:
Example Comments
======= ========
--
-- This is an include file for Comment at the beginning
-- my favorite tool
--
Blank lines are allowed
--
-- The following include file
-- contains the names of the Another comment
-- Ada source files in compilation
-- order
--
@mytool.cmp
--
-- The following are the documentation
-- files
--
mytool.ref
mytool.doc
mytool.idx
A single letter "P" may be used rather than the full
"PAGE" verb. An example of the execution of the PAGE
command is:
PAGER2> page
PAGE Command requires the name of the paged file and include file
Syntax: page [@include_file_name|file_name]+ paged_file_name
PAGER2> p @demo.inc demo.src
Adding demo.inc -- 8 Lines
Adding demo1.txt -- 1 Lines
Adding demo2.txt -- 1 Lines
2.2. UNPAGE Command
The UNPAGE function extracts the components from
the indicated paged file, leaving the original paged
file intact. The syntax of UNPAGE is:
UNPAGE paged_filename
The single letter "U" may be used rather than the full
"UNPAGE" verb. An example of the execution of the UNPAGE
command is:
Richard Conn Page 3
PAGER2
PAGER2> unpage
UNPAGE Command requires the name of a paged file
Syntax: unpage paged_file_name
PAGER2> u demo.src
Extracting demo.inc -- 8 Lines
Extracting demo1.txt -- 1 Lines
Extracting demo2.txt -- 1 Lines
2.3. LIST Command
The LIST function is used to create a text file
containing the names of the component files within a
paged file. The syntax of the LIST command is:
LIST paged_file_name
The single letter "L" may be used rather than the full
"LIST" verb. An example of the execution of the LIST
command is:
PAGER2> list
LIST Command requires the name of a paged file
Syntax: list paged_file_name
PAGER2> list demo.src
demo.inc -- 8 Lines
demo1.txt -- 1 Lines
demo2.txt -- 1 Lines
2.4. INCLUDE Command
The INCLUDE command performs the same function of the
LIST command, but it places the output into an includ